<?php
/**
 * 管理员数据模块
 * @author
 */

class MasterModel extends CommonModel
{
    public function _before_fetch_datagrid($page = 1, $rows = 10)
    {
        $order_by = isset($_REQUEST['sort']) ? trim($_REQUEST['sort']) . ' ' .  trim($_REQUEST['order']) : 'user_id desc';
        $this->total = $this->count();
        $this->order($order_by);
        $this->limit($rows)->page($page);
        $this->rows = $this->select();
    }
}